---
title: clsTeamAssignmentCollection
summary: API reference for clsTeamAssignmentCollection.
status: draft
owner: SAIF Corporation
last_reviewed: 2026-08-21
library: SAIF.Business.View.Policy
reference_type: embedded
---

# clsTeamAssignmentCollection

`clsTeamAssignmentCollection` retrieves and holds the policy's assigned service-team roster. `clsPolicyData` uses it as a lazy child collection, loading rows from Oracle procedure `pk72846_view_policy.team_assign_query`, converting role codes into the `TeamFunctions` enum, optionally masking row data for demo users, and offering collection-wide email initialization helpers for the external lookup paths.

## Purpose
- Materialize the policy service-team query into business objects that callers can search by index or team role.
- Normalize database role codes into the shared `TeamFunctions` enum used by authorization and UI code.
- Provide collection-wide hooks for the email lookup rules implemented on each `clsTeamAssignment` ([BR-VP-022](../../business-rules.md#br-vp-022-team-member-email-address-derivation)).

## Context
- Namespace: `SAIF.Business.View.Policy`
- Assembly/package: `SAIF.Business.View.Policy` (embedded)

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| `GetTeamAssignmentCollection` | `Public Shared Function GetTeamAssignmentCollection(ByVal inDataportal As IDataPortalInfo, ByVal inPolicyNum As Decimal, Optional ByVal inMaskData As Boolean = False) As clsTeamAssignmentCollection` | Retrieves the policy's service-team rows from `pk72846_view_policy.team_assign_query` and optionally marks them for demo masking. |
| `GetTeamAssignmentCollection` | `Public Shared Function GetTeamAssignmentCollection(ByVal inDataportal As IDataPortalInfo, ByVal inSQLServerDataPortal As IDataPortalInfo, ByVal inPolicyNum As Decimal, Optional ByVal inMaskData As Boolean = False) As clsTeamAssignmentCollection` | Preserves a second SQL Server DPI parameter for callers that pair team retrieval with the external email-lookup path, even though the collection itself is still loaded from the primary portal. |
| `Item` | `Default Public ReadOnly Property Item(ByVal Index As Integer) As clsTeamAssignment` | Returns the team member at a specific collection position. |
| `Item` | `Default Public ReadOnly Property Item(ByVal inTeamFunction As TeamFunctions) As clsTeamAssignment` | Returns the first team member assigned to a requested functional role, such as loss-control consultant or underwriter. |
| `HasAgentData` | `Public ReadOnly Property HasAgentData() As Boolean` | Indicates whether the result set includes an `AGENCY` team-member-type row for online loss-run scenarios. |
| `HasProducerData` | `Public ReadOnly Property HasProducerData() As Boolean` | Indicates whether the result set includes a `PRODUCER` team-member-type row for online loss-run scenarios. |
| `Add` | `Public Shadows Function Add(ByVal inTeamAssignment As clsTeamAssignment) As Integer` | Appends a fully built team assignment to the collection. |
| `Contains` | `Public Overloads Function Contains(ByVal inTeamAssignment As clsTeamAssignment) As Boolean` | Tests whether an equivalent team assignment object is already present. |
| `Contains` | `Public Overloads Function Contains(ByVal inTeamFunction As TeamFunctions) As Boolean` | Tests whether the policy currently has an assignment for a requested functional role. |
| `InitializeEmaillAddress` | `Public Sub InitializeEmaillAddress(ByVal inDataportal As IDataPortalInfo)` | Obsolete misspelled helper that forwards external email initialization to each row. |
| `InitializeEmailAddress` | `Public Sub InitializeEmailAddress(ByVal inSQLServerDataPortal As IDataPortalInfo)` | Runs the SQL Server external-client email lookup for each assignment that needs it ([BR-VP-022](../../business-rules.md#br-vp-022-team-member-email-address-derivation)). |
| `InitializeEmailAddressUsingSystemUser` | `Public Sub InitializeEmailAddressUsingSystemUser(ByVal inDataportal As IDataPortalInfo)` | Runs the system-user email lookup path for each assignment that needs it ([BR-VP-022](../../business-rules.md#br-vp-022-team-member-email-address-derivation)). |
| `TeamFunctions` | `Public Enum TeamFunctions` | Enumerates the recognized policy team roles and shields callers from the underlying short database codes. |

## Behavioral notes
- `BeforeRetrieve` always calls `pk72846_view_policy.team_assign_query` with `apolicynum`.
- `AfterRetrieve` creates one `clsTeamAssignment` per row, copies the criteria's `MaskData` flag onto the row object, and then lets the row object load itself.
- The collection-level overload that accepts a second SQL Server DPI exists to support the external email lookup workflow; retrieval still comes from the first portal and the SQL Server portal is used later through `InitializeEmailAddress`.
- `CodeToTeamFunction` maps unrecognized codes to `Unknown`, which intentionally ignores extra non-team rows such as office/CST rows mentioned in the source comments.*

## Constraints and usage notes
- This collection inherits from an external BOF base class, so inherited members are not documented here.
- Consumers that need external email addresses must call one of the initialization helpers after retrieval; the collection does not do that automatically.
- The criteria object is read-only and returns invalid-SQL exceptions for create/insert/update/delete operations.

> **Note:** Statements marked with * were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts. Statements
> marked with ** could not be confirmed; treat as unknown until verified.

## Sources
- `SAIF.Business.View.Policy/clsTeamAssignmentCollection.vb`
